package com.周阳.中介者模式.智能家居案例;

/**
 * 具体中介者：电视机
 */
public class TV extends Colleague {

    public TV(Mediator mediator, String name) {
       super(mediator, name);
        mediator.Register(name, this);


    }

    @Override
    public void SendMessage(int stateChange) {
            this.GetMediator().GetMessage(stateChange, this.name);
    }

    //打开电视机行为
    public void StartTv() {
            System.out.println("It's time to StartTv!");
    }

    //关闭电视机行为
    public void StopTv() {
            System.out.println("StopTv!");
    }
}
